package com.digitalchina.lxnsy.activity.farmTrain;

import android.webkit.JavascriptInterface;

import com.digitalchina.lxnsy.base.BaseHtmlActivity;
import com.digitalchina.lxnsy.toolkit.StringUtil;
import com.digitalchina.lxnsy.toolkit.Utils;

/**
 * ================================================
 * 项目名称：android
 * 类描述：我的报价列表
 * 创建人：yzm
 * 创建时间：2020/1/8 17:26
 * 修改备注：
 * ================================================
 */
public class MyQuoteListActivity extends BaseHtmlActivity {

    @Override
    protected void loadHtml() {
        webView.addJavascriptObject(new JsApi(), null);
        loadUrl("train-my-quote");
        setTitle("我的报价列表");
    }

    @Override
    public void rightOnClick() {

    }

    public class JsApi {
        //报价详情
        @JavascriptInterface
        public void quoteDetail(Object msg) {
            go(TrainQuoteDetailsActivity.class);
        }

        //需求详情
        @JavascriptInterface
        public void demandDetail(Object msg) {
            go(DemandDetailActivity.class, "msg", "2");
        }

        //联系需求方
        @JavascriptInterface
        public void callPhone(Object msg) {
            if (msg != null) {
                String tel = msg.toString();
                if (!StringUtil.isStrEmpty(msg.toString())) {
                    Utils.callPhone(activity, tel);
                }
            }
        }
    }
}
